package com.laijiale.dto;

import cn.hutool.core.date.DateTime;
import com.laijiale.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author laijiale
 * @date 2025年01月11日 10:00
 */

@Schema(name="优惠券添加DTO")
@Data
public class CouponsUpdateDTO implements Serializable, RE {
    @NotEmpty(message = "兑换码不能为空")
    @Schema(description = "兑换码")
    private String code;
    @NotEmpty(message = "标题不能为空")
    @Pattern(regexp = TITLE_RE, message = TITLE_RE_MSG)
    @Schema(description = "标题")
    private String title;
    @NotNull(message = "优惠价格不能为空")
    @Schema(description = "优惠价格")
    private Double cpPrice;
    @NotNull(message = "开始时间不能为空")
    @Schema(description = "开始时间")
    private DateTime startTime;
    @NotNull(message = "结束时间不能为空")
    @Schema(description = "结束时间")
    private DateTime endTime;
    @Schema(description = "描述")
    private String info;

}
